#ifndef ANIM_H
#define ANIM_H
#include <SFML/Graphics.hpp>
#include <string>
#include <iostream>
#include <vector>

#include "MainLoader.h"

class Anim
{
    public:
        Anim(std::string true_name,std::string nom,unsigned int nbr,MainLoader *mdat,std::vector<int> V, bool reset,bool idle);
        virtual ~Anim();
        std::string GetName() {return name;}
        std::string GetTName() {return abb_name; }
        //std::vector<sf::Sprite> Getseq_sprite() { return seq_sprite; }
        //void Setseq_sprite(std::vector<sf::Sprite> val) { seq_sprite = val; }
        std::vector<int> Getseq_time() { return seq_time; }
        void Setseq_time(std::vector<int> val) { seq_time = val; }
        int Getcurrent_seq() { return current_seq; }
        void Setcurrent_seq(int val) { current_seq = val; }
        int Getcurrent_time() { return current_time; }
        void Setcurrent_time(int val) { current_time = val; }
        bool Getreset_seq() { return reset_seq; }
        void Setreset_seq(bool val) { reset_seq = val; }
        void Pars();
        sf::Sprite GetSprite();
        bool Ret_Idle();



        void reset() {
            if(reset_seq&&(current_seq==(Nb_sprite-1))){
            current_seq=0;
            current_time=0;
            }
        }
    protected:
    private:
        std::string name;
        std::string abb_name;
        unsigned int Nb_sprite;
        MainLoader *Data;
        //std::vector<sf::Sprite> seq_sprite;
        std::vector<int> seq_time;
        sf::Image m_Image;
        sf::Sprite m_Sprite;
        unsigned int current_seq;
        int current_time;
        bool reset_seq;
        bool idle_ret;
        bool droite;
};

#endif // ANIM_H
